import request from '../utils/request.js';

//查询所有菜单
export function findAllMenu(data){
  return request({
    url:'/rbacMenu/',
    method:'get',
  })
}

//根据id查询对应菜单
export function findAll(id){
    return request({
      url:'/rbacMenu/'+id,
      method:'get',
    })
}

//根据id查询对应菜单id
export function findAllId(data){
  return request({
    url:'/rbacMenu/findAllId?id='+data,
    method:'get',
  })
}

//根据id删除菜单
export function deleteMenu(id){
  return request({
    url:'/rbacMenu/'+id,
    method:'put',
  })
}

//添加选中菜单
export function insertMenu(id,roleId){
  return request({
    url:'/rbacMenu/insertMenu/'+id+'/'+roleId,
    method:'put',
  })
}

export function editOne(data){
    return request({
      url:'/rbacMenu/',
      method:'post',
      data
    })
}

export function updateMenu(id,fid) {
    return request({
      url: '/rbacMenu/'+id+'/'+fid,
      method: 'put',
    })
}
export function addOne(data) {
  return request({
    url: '/rbacMenu/addOne',
    method: 'post',
    data
  })
}
export function deleteOne(id) {
  return request({
    url: '/rbacMenu/deleteOne/'+id,
    method: 'put',
  })
}

